@use '../core/style/variables';
@use '../core/style/vendor-prefixes';
@use '../../cdk/a11y/a11y';


// Styles that only apply to the standard appearance of the form-field.

// The height of the underline.
$standard-underline-height: 1px !default;
// The padding between the top of the form field and the label text (used to align the standard
// form field with the fill and outline appearances).
$standard-padding-top: 0.75em !default;


.mat-form-field-appearance-standard {
  .mat-form-field-flex {
    padding-top: $standard-padding-top;
  }

  // The underline is what's shown under the control, its prefix and its suffix.
  // The ripple is the blue animation coming on top of it.
  .mat-form-field-underline {
    height: $standard-underline-height;

    @include a11y.high-contrast(active, off) {
      height: 0;
      border-top: solid $standard-underline-height;
    }
  }

  .mat-form-field-ripple {
    $height: $standard-underline-height * 2;
    bottom: 0;
    height: $height;

    @include a11y.high-contrast(active, off) {
      height: 0;
      border-top: solid $height;
    }
  }

  &.mat-form-field-disabled .mat-form-field-underline {
    background-position: 0;
    background-color: transparent;

    @include a11y.high-contrast(active, off) {
      border-top-style: dotted;
      border-top-width: 2px;
    }
  }

  // Note that we need this specific of a selector because we don't want
  // the hover effect to show when the user hovers over the hints.
  &:not(.mat-form-field-disabled) .mat-form-field-flex:hover ~ .mat-form-field-underline {
    .mat-form-field-ripple {
      opacity: 1;
      transform: none;
      transition: opacity 600ms variables.$swift-ease-out-timing-function;
    }
  }

  &._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover {
    & ~ .mat-form-field-underline .mat-form-field-ripple {
      transition: none;
    }
  }
}
